﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DayDayUp.Core;
using DayDayUp.Service.Posts;

namespace DayDayUp.Controllers
{
    public class HomeController : Controller
    {
        private IPostService _postService;
        private IWorkContext _workContext;

        public HomeController(IPostService postService, IWorkContext workContext)
        {
            _postService = postService;
            _workContext = workContext;
        }

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }


        public string NewPost()
        {
            _postService.SaveNewPost("kkkk","dfdfdf",_workContext.CurrentUser.Id, new string[]{"kkkk"},true );
            return "success";
        }
    }
}